// ==UserScript==
// @name         梦游漫画去广告
// @namespace    tampermonkey
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        *://mumumh.com/book/*
// @match        *://mumumh.com/chapter/*
// @icon         https://mumumh.com/favicon.ico
// @grant        none
// @run-at       document-end
// @require      https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js
// ==/UserScript==

(function() {
    'use strict';
    let count = 0;

    let handle = setInterval(function(){
        let items = $(".swing");
        for(let i = items.length - 1; i >= 0; i--) {
            items[i].remove();
            count++;
        }
        if(2 == count) {
            clearInterval(handle);
        }
    },500);

    let items = $("script");
    for(let i = items.length - 1; i >= 0; i--) {
        items[i].remove();
    }

    let foot2 = $("div.view-fix-bottom-bar");
    let handle2 = setInterval(function(){
        let items = foot2.nextAll();
        if(items.length > 1) {
            for(let i = items.length - 1; i >= 0; i--) {
                items[i].remove();
            }
            clearInterval(handle2);
        }
    },500);

    let foot1 = $("#tempc");
    let handle1 = setInterval(function(){
        let items = foot1.nextAll();
        if(items.length > 1) {
            for(let i = items.length - 1; i >= 2; i--) {
                items[i].remove();
            }
            clearInterval(handle1);
        }
    },500);
    $("ins").remove();
    $(".view-fix-bottom-bar").next().remove();
})();